<template>
	<!-- #ifndef MP-WEIXIN -->
	<view>
		<el-container>
			<el-header>
				<span>广东美食后台管理</span>
				<text @click="exitLogin">退出登录</text>
			</el-header>
			<el-main>
				<view>
					<el-row>
						<el-col :span="3">
							<el-button round @click="comName='UserInfo'"><i class="el-icon-user-solid"></i>用户信息管理
							</el-button>
						</el-col>
						<el-col :span="3">
							<el-button round @click="comName='FileManagement'"><i class="el-icon-folder-opened"></i>笔记管理
							</el-button>
						</el-col>
					</el-row>
					<view style='background-color:#f1f1f1; padding: 0 20rpx;'>
						<view :class="comName=='AddUser'||'Data'?'editstyle':''">
							<component :is="comName" @editPage="editPage" :userList="userList"></component>
						</view>
					</view>
				</view>
			</el-main>
		</el-container>
	</view>
	<!-- #endif -->
</template>

<script>
	import UserInfo from '@/components/adminBox/UserInfo'
	import FileManagement from '@/components/adminBox/FileManagement'
	import Data from '@/components/adminBox/Data'

	export default {
		components: {
			UserInfo,
			FileManagement,
			Data
		},
		data() {
			return {
				comName: "UserInfo",
				userList:[]
			}
		},
		methods: {
			editPage(data) {
				this.userList=data
				this.comName = 'Data'
				
			},
			exitLogin() {
				uni.removeStorageSync("token")
				uni.redirectTo({
				    url: '../userLogin/userLogin'
				});
			}
		}
	};
</script>

<style>
	.el-header {
		background-color: #cde6c7;
		color: #000;
		line-height: 60px;
		font-size: 18px;
		font-weight: 700;
		letter-spacing: 0.05em;
		text-transform: uppercase;
		display: flex;
		justify-content: space-between;
	}

	.editstyle {
		padding: 30px 0;

	}
</style>
